var express = require('express');
var router = express.Router();
var userCtl=require("../controls/user/user");
var upload=require('../public/uploadFile').upload;
/* GET users listing. */
router.post("/login",userCtl.login);
router.post("/regist",userCtl.regist);
router.post("/updateupass",userCtl.updateUpass);

router.get("/getUserImg",userCtl.getUserImg);

// 修改头像
router.post("/uploadAvatar", upload.single("Avatar_img"),userCtl.uploadAvator);


router.post("/collectNews",userCtl.collectNews);
router.delete("/cancelCollection",userCtl.cancelCollection);
router.get("/getNewsCollect",userCtl.getNewsCollect)
// 
router.get("/isCollect",userCtl.isCollect)
router.get("/uNewsCollectTotal",userCtl.uNewsCollectTotal);

// 用户给新闻点赞
router.post("/thumbsUp",userCtl.thumbsUp);
router.delete("/cancelThumbsUp",userCtl.cancelThumbsUp);
router.get("/isThumbsUp",userCtl.isThumbsUp);
// 用户给评论点赞
router.post("/CommThumbsUp",userCtl.CommThumbsUp);
router.delete("/cancelCommThumbsUp",userCtl.cancelCommThumbsUp);
// 用户取消评论点赞
// router.post("/addNewsHistory",userCtl.addNewsHistory);
router.get("/getNewsHistory",userCtl.getNewsHistory);



module.exports = router;


